package com.workday.gridsimulator

object TimeHelper {

  def formatTime(time:Double): String = {
    
    val twoDecimalPlaces = new java.text.DecimalFormat("##.00")
    
    val totalMins = time.toInt/60
    val hours = totalMins/60
    val mins = totalMins % 60
    val secs = time - (totalMins*60)
    
    val formattedTime = hours + ":" + mins + ":" + twoDecimalPlaces.format(secs)
    formattedTime
  }

}